package com.ruoyi.consume.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.consume.mapper.StromaConsumeTemporayMapper;
import com.ruoyi.consume.domain.StromaConsumeTemporay;
import com.ruoyi.consume.service.IStromaConsumeTemporayService;

/**
 * 查看临时领用信息Service业务层处理
 *
 * @author ruoyi
 * @date 2021-07-27
 */
@Service
public class StromaConsumeTemporayServiceImpl implements IStromaConsumeTemporayService
{
    @Autowired
    private StromaConsumeTemporayMapper stromaConsumeTemporayMapper;

    /**
     * 查询查看临时领用信息
     *
     * @param stromaConsumeTemporayId 查看临时领用信息ID
     * @return 查看临时领用信息
     */
    @Override
    public StromaConsumeTemporay selectStromaConsumeTemporayById(Long stromaConsumeTemporayId)
    {
        return stromaConsumeTemporayMapper.selectStromaConsumeTemporayById(stromaConsumeTemporayId);
    }

    /**
     * 查询查看临时领用信息列表
     *
     * @param stromaConsumeTemporay 查看临时领用信息
     * @return 查看临时领用信息
     */
    @Override
    public List<StromaConsumeTemporay> selectStromaConsumeTemporayList(StromaConsumeTemporay stromaConsumeTemporay)
    {
        return stromaConsumeTemporayMapper.selectStromaConsumeTemporayList(stromaConsumeTemporay);
    }

    /**
     * 新增查看临时领用信息
     *
     * @param stromaConsumeTemporay 查看临时领用信息
     * @return 结果
     */
    @Override
    public int insertStromaConsumeTemporay(StromaConsumeTemporay stromaConsumeTemporay)
    {
        stromaConsumeTemporay.setCreateTime(DateUtils.getNowDate());
        return stromaConsumeTemporayMapper.insertStromaConsumeTemporay(stromaConsumeTemporay);
    }

    /**
     * 修改查看临时领用信息
     *
     * @param stromaConsumeTemporay 查看临时领用信息
     * @return 结果
     */
    @Override
    public int updateStromaConsumeTemporay(StromaConsumeTemporay stromaConsumeTemporay)
    {
        stromaConsumeTemporay.setUpdateTime(DateUtils.getNowDate());
        return stromaConsumeTemporayMapper.updateStromaConsumeTemporay(stromaConsumeTemporay);
    }

    /**
     * 批量删除查看临时领用信息
     *
     * @param stromaConsumeTemporayIds 需要删除的查看临时领用信息ID
     * @return 结果
     */
    @Override
    public int deleteStromaConsumeTemporayByIds(Long[] stromaConsumeTemporayIds)
    {
        return stromaConsumeTemporayMapper.deleteStromaConsumeTemporayByIds(stromaConsumeTemporayIds);
    }

    /**
     * 删除查看临时领用信息信息
     *
     * @param stromaConsumeTemporayId 查看临时领用信息ID
     * @return 结果
     */
    @Override
    public int deleteStromaConsumeTemporayById(Long stromaConsumeTemporayId)
    {
        return stromaConsumeTemporayMapper.deleteStromaConsumeTemporayById(stromaConsumeTemporayId);
    }

    /**
     * 获取用户下拉框
     *
     * @param
     * @return 结果
     */
    @Override
    public List<StromaConsumeTemporay> getUserName(){
        return stromaConsumeTemporayMapper.getUserName();
    }
}
